package whf.framework.log.events;

import org.hibernate.event.PreUpdateEvent;
import org.hibernate.event.PreUpdateEventListener;

import whf.framework.entity.Entity;
import whf.framework.log.env.Environment;
import whf.framework.log.util.AuditUtils;
import whf.framework.log.util.LogConfig;

/**
 * @author king
 * @create 2008-1-21 下午09:43:50
 * 
 */
@SuppressWarnings("serial")
public class HibernatePreUpdateEventListener implements PreUpdateEventListener {

	/* (non-Javadoc)
	 * @see org.hibernate.event.PreUpdateEventListener#onPreUpdate(org.hibernate.event.PreUpdateEvent)
	 */
	public boolean onPreUpdate(PreUpdateEvent event) {
//		Entity entity = (Entity)event.getEntity();
//		if(LogConfig.isHistoriable(entity.getClass()) && !Environment.isLogIgnoredEntity(entity)) {
//			Entity oldValue = Environment.get(entity);
//			AuditUtils.getInstance().logUpdate(null, entity, oldValue);
//		}
		return false;
	}

}
